var index = parent.layer.getFrameIndex(window.name);
var currentBlockId = parent.$("#blockid").val();
window.onload = function () {
    $("#dataName").val($("#"+currentBlockId+"_text", window.parent.document).html());
    $('#saveSetting').click(function () {
        var name = $("#dataName").val();
        if(name!=""){
            $("#"+currentBlockId+"_text", window.parent.document).html(name);
            $("#"+currentBlockId+"_text", window.parent.document).attr("title",name);
            parent.layer.close(index);
        }else{
            layer.alert("请输入外部数据源名字！");
        }
    });
    $('#closeIframe').click(function(){
        parent.layer.close(index);
    });
}
